home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rwvector.lha
/
RWVector2.1
/
src
/
xgemat.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1989-08-18
|
2KB
|
103 lines
/*
* Definitions for <A>GEMatrix
*
* Copyright (C) 1988, 1989.
*
* Dr. Thomas Keffer
* Rogue Wave Associates
* P.O. Box 85341
* Seattle WA 98145-1341
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and
* without fee is hereby granted, provided that the
* above copyright notice appear in all copies and that
* both that copyright notice and this permission notice
* appear in supporting documentation.
*
* This software is provided "as is" without any
* expressed or implied warranty.
*
*
* @(#)xgemat.cc 2.1 8/18/89
*/
#define NO_VECTOR_MATHFUN
#include "rw/<A>GEMatrix.h"
<A>GEMatrix::<A>GEMatrix() :
()
{
nrows = 0;
ncols = 0;
}
<A>GEMatrix::<A>GEMatrix(int rows, int cols) :
(rows*cols)
{
nrows = rows;
ncols = cols;
}
<A>GEMatrix::<A>GEMatrix(int rows, int cols, <T> initval) :
(rows*cols, initval)
{
nrows = rows;
ncols = cols;
}
<A>GEMatrix::<A>GEMatrix(const <A>GEMatrix& m) :
(*(<T>Vec*)&m) // Cast necessary for g++ bug
{
nrows = m.nrows;
ncols = m.ncols;
}
<A>GEMatrix::<A>GEMatrix(const <T>* v, int rows, int cols) :
(v, rows*cols)
{
nrows = rows;
ncols = cols;
}
<A>GEMatrix::<A>GEMatrix(const <T>Vec& v, int rows, int cols) :
(v)
{
nrows = rows;
ncols = cols;
assertLength(v);
}
<A>GEMatrix&
<A>GEMatrix::operator=(const <A>GEMatrix& m)
{
// Copy the base class over:
<T>Vec::operator=(m);
nrows = m.nrows;
ncols = m.ncols;
return *this;
}
<A>GEMatrix&
<A>GEMatrix::operator=(<T> s)
{
// Copy the base class over:
<T>Vec::operator=(s);
return *this;
}
<A>GEMatrix&
<A>GEMatrix::reference(<A>GEMatrix& m)
{
<T>Vec::reference(m);
nrows = m.nrows;
ncols = m.ncols;
return *this;
}
<A>GEMatrix
<A>GEMatrix::deepCopy()
{
return <A>GEMatrix(<T>Vec::deepCopy(), nrows, ncols);
}